// run: $exec < input
// opt: 0
// flag: -g
#include <iostream>
#include <algorithm>
#include <functional>
#include <queue>

long long const maxn = 100007;
long long come[maxn];
long long done1[maxn], done2[maxn], done3[maxn];
long long k1, k2, k3, t1, t2, t3, n;

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> k1 >> k2 >> k3;
	std::cin >> t1 >> t2 >> t3;
	std::cin >> n;
	std::priority_queue<long long, std::vector<long long>, std::greater<long long>> pq;
	for (long long i = 0; i < n; i++) {
		std::cin >> come[i];
		long long time = come[i];
		while (!pq.empty() && pq.top() <= time) pq.pop(), k1++;
		if (k1) {
			k1--; done1[i] = time + t1;
			pq.push(done1[i]);
		} else {
			long long t = pq.top(); pq.pop();
			done1[i] = t + t1;
			pq.push(done1[i]);
		}
	}

	while (!pq.empty()) pq.pop();
	for (long long i = 0; i < n; i++) {
		long long time = done1[i];
		while (!pq.empty() && pq.top() <= time) pq.pop(), k2++;
		if (k2) {
			k2--; done2[i] = time + t2;
			pq.push(done2[i]);
		} else {
			long long t = pq.top(); pq.pop();
			done2[i] = t + t2;
			pq.push(done2[i]);
		}
	}

	while (!pq.empty()) pq.pop();
	for (long long i = 0; i < n; i++) {
		long long time = done2[i];
		while (!pq.empty() && pq.top() <= time) pq.pop(), k3++;
		if (k3) {
			k3--; done3[i] = time + t3;
			pq.push(done3[i]);
		} else {
			long long t = pq.top(); pq.pop();
			done3[i] = t + t3;
			pq.push(done3[i]);
		}
	}

	long long max = 0;
	for (long long i = 0; i < n; i++)
		max = std::max(max, done3[i] - come[i]);
	std::cout << max << '\n';
}

